import CreatePowerStation from '@/pages/OwnerMain/CreatePowerStation';
import DCUWorkingMode from '@/pages/OwnerMain/DCUWorkingMode';
import ZeroExportConfigScreen from '@/pages/OwnerMain/ZeroExportConfigScreen';
import SelectDeviceCategory from '@/pages/OwnerMain/SelectDeviceCategory';
import SetupDeviceNetwork from '@/pages/OwnerMain/SetupDeviceNetwork';
import DeviceInfo from '@/pages/OwnerMain/Device/DeviceInfo';
import InverterControlScreen from '@/pages/OwnerMain/InverterControl';
import DiscoverDevices from '@/pages/OwnerMain/DiscoverDevices';
import OwnerStationListScreen from "@/pages/OwnerMain/OwnerStationListScreen";
import FullScreen from '@/components/Landscape';

const OwnerRoutes: ReactNavigation.RouteType[] = [
  {
    name: 'Owner',
    component: require('@/pages/scene/Owner').default,
    options: {
      headerShown: false,
    },
  },
  {
    name: 'UserProfile',
    component: require('@/pages/common/UserProfile').default,
    options: t => ({
      title: t('personal.name'),
    }),
  },
  {
    name: 'DeviceInfo',
    component: DeviceInfo,
    options(_, theme) {
      return {
        headerStyle: {
          backgroundColor: theme.colors.background,
        },
        headerBackButtonDisplayMode: 'minimal',
      };
    },
  },
  {
    name: 'Scan',
    component: require('@/pages/OwnerMain/Device/components/addDevice')
      .ScanCode,
    options: {
      headerTransparent: true,
      headerShadowVisible: false,
      headerTitle: '',
      headerTintColor: '#FFF',
      headerStyle: {
        backgroundColor: 'transparent'
      }
    },
  },
  {
    name: 'SNCode',
    component: require('@/pages/OwnerMain/Device/components/addDevice').SNCode,
    options: (t) => ({
      title: t('password.serial.number'),
    }),
  },
  {
    name: 'InstCode',
    component: require('@/pages/InstCode/index').default,
    options: (t, theme) => ({
      headerTitle: t('settings.installer'),
      headerStyle: {
        backgroundColor: theme.colors.background,
      },
    }),
  },
  {
    name: 'DeviceManage',
    component: require('@/pages/OwnerMain/Device/DeviceManage').default,
  },
  {
    name: 'General',
    component: require('@/pages/common/General').default,
    options: t => ({
      headerTitle: t('common.general'),
    }),
  },
  {
    name: 'AccountSecurity',
    component: require('@/pages/common/Profile/AccountSecurity').default,
    options: (t, theme) => ({
      headerTitle: t('userSetting.account_security'),
      headerStyle: {
        backgroundColor: theme.colors.background,
      },
    }),
  },
  {
    name: 'ChangeEmail',
    component: require('@/pages/common/ChangeEmail').default,
    options: t => ({
      headerTitle: t('userSetting.SecuritySettings.form.label.email'),
    }),
  },
  {
    name: 'ChangePassword',
    component: require('@/pages/common/Profile/ChangePassword').default,
    options: t => ({
      headerTitle: t('user.changePsd'),
    }),
  },
  {
    name: 'PVChart',
    component: require('@/pages/OwnerMain/Device/PVTimeChart').default,
    options: t => ({
      title: t('device.PVdata'),
    }),
  },
  {
    name: 'EquipTimeChart',
    component: require('@/pages/OwnerMain/Device/EquipTimeChart').default,
    options: t => ({
      title: t('device.output_power'),
    }),
  },
  {
    name: 'DeviceControl',
    component: require('@/pages/OwnerMain/Device/DeviceControl').default,
    options: t => ({
      title: t('device.equipment_control'),
    }),
  },
  {
    name: 'SelectDeviceCategory',
    component: SelectDeviceCategory,
    options: t => ({
      title: t('device.common.add.device', {defaultValue: '添加设备'}),
    }),
  },
  {
    name: 'CreatePowerStation',
    component: CreatePowerStation,
    options: t => ({
      title: t('sys.app.station.create', {defaultValue: '新建电站'}),
    }),
  },
  {
    name: 'SetupDeviceNetwork',
    component: SetupDeviceNetwork,
    options: t => ({
      title: t('sys.app.setup.network', {defaultValue: '配网'}),
    }),
  },
  {
    name: 'ZeroExportConfigScreen',
    component: ZeroExportConfigScreen,
    options: t => ({
      title: t('sys.app.micro.inverter.control', {
        defaultValue: '防逆流设置',
      }),
    }),
  },
  {
    name: 'DCUWorkingMode',
    component: DCUWorkingMode,
    options: t => ({
      title: t('sys.app.dcu.working.mode', {defaultValue: 'DCU工作模式'}),
    }),
  },
  {
    name: 'InverterControl',
    component: InverterControlScreen,
    options: t => ({
      title: t('sys.app.micro.inverter.control', {
        defaultValue: '逆变器控制',
      }),
    }),
  },
  {
    name: 'DiscoverDevices',
    component: DiscoverDevices,
    options: t => ({
      title: t('sys.app.discover.devices', {defaultValue: '发现设备'}),
    }),
  },
  {
    name: 'FullScreen',
    component: FullScreen,
    options: () => ({
      headerShown: false,
    }),
  },
  {
    name: 'OwnerStationList',
    component: OwnerStationListScreen,
    options: (t) => ({
      title: t('mn.station.list', { defaultValue: '管理电站' }),
    }),
  }
];

export default OwnerRoutes;
